using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_ProfitAndLossMap : EntityTypeConfiguration<t_ProfitAndLoss>
    {
        public t_ProfitAndLossMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FYear, t.FPeriod, t.FAccountID, t.FDetailID, t.FCurrencyID });

            // Properties
            this.Property(t => t.FYear)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FPeriod)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FAccountID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FDetailID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FCurrencyID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("t_ProfitAndLoss");
            this.Property(t => t.FYear).HasColumnName("FYear");
            this.Property(t => t.FPeriod).HasColumnName("FPeriod");
            this.Property(t => t.FAccountID).HasColumnName("FAccountID");
            this.Property(t => t.FDetailID).HasColumnName("FDetailID");
            this.Property(t => t.FCurrencyID).HasColumnName("FCurrencyID");
            this.Property(t => t.FAmountFor).HasColumnName("FAmountFor");
            this.Property(t => t.FYtdAmountFor).HasColumnName("FYtdAmountFor");
            this.Property(t => t.FAmount).HasColumnName("FAmount");
            this.Property(t => t.FYtdAmount).HasColumnName("FYtdAmount");
            this.Property(t => t.FFrameWorkID).HasColumnName("FFrameWorkID");
        }
    }
}
